﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Cartoon.Skin
{
    public class SkinFactory
    {
        public static ISkin GetSkin(string skinname)
        {
            if (SkinCache.ContainsKey(skinname) == true)
            { 
                return SkinCache[skinname];
            }

            ISkin skin;
            switch (skinname)
            { 
                case "Default":
                    skin = new SkinDefault();
                    break;
                case "SiShen":
                    skin = new SkinSiShen();
                    break;
                default:                
                    skin = new SkinDefault();
                    break;
            }

            SkinCache.Add(skin.SkinName, skin);

            return skin;
        }

        protected static System.Collections.Generic.Dictionary<string, ISkin> SkinCache = new Dictionary<string, ISkin>();

         
    }
}
